﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LIMS.Web
{
    public partial class StuMessageList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rpMessage.DataSource = BLL.MessageManager.SearchMessage(null).Take(3);
                rpMessage.DataBind();

                AspNetPager1.RecordCount = BLL.MessageManager.SearchMessage(null).Count;
            }
        }

        protected String ConventCodeToString(object statusCode)
        {
            return statusCode != null ? (statusCode.ToString() == "0" ? "未处理" : "已处理") : "未处理";
        }

        protected String ConventIdToName(object adminID)
        {
            return (adminID == null || String.IsNullOrWhiteSpace(adminID.ToString())) ? "" : BLL.AdminManager.GetAdmNameByID(adminID.ToString());
        }

        protected void rpMessaget_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {


        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            rpMessage.DataSource = BLL.MessageManager.SearchMessage(null).
                Skip(AspNetPager1.PageSize * AspNetPager1.StartRecordIndex).Take(AspNetPager1.PageSize);
            rpMessage.DataBind();
        }
    }
}